﻿using MediatR;
using T.Personnel.Domain;
using T.Personnel.Read.API.Application.Command.ResignationManageCommand;
using T.Personnel.Repository.Interface;

namespace T.Personnel.Read.API.Application.CommandHandler.ResignationManageHandler
{
    public class GetResignationManageHandler : IRequestHandler<GetResignationManageCommand, Manage>
    {
        private readonly IManageRepository manageRepository;

        public GetResignationManageHandler(IManageRepository manageRepository)
        {
            this.manageRepository = manageRepository;
        }

        public async Task<Manage> Handle(GetResignationManageCommand request, CancellationToken cancellationToken)
        {
            return await manageRepository.GetResignationAsync(request.id);
        }
    }
}
